<?php
if($_GET['pass']!='kingphp'){die('pass error');}
$domain=$_GET['domain'];
$locallockfile=dirname(__FILE__).'/locklist.php';
if(file_exists($locallockfile)){
	$lockdomains=json_decode(file_get_contents($locallockfile),true);
}else{
	$lockdomains=array();
}

if($_GET['act']=='add'){
	if(!in_array($domain,$lockdomains)){
		$lockdomains[]=$domain;
	}
	file_put_contents($locallockfile,json_encode($lockdomains));
}

if($_GET['act']=='delete'){
	if(in_array($domain,$lockdomains)){
		foreach($lockdomains as $k=>$d){
			if($d==$domain){unset($lockdomains[$k]);}
		}
	}
	file_put_contents($locallockfile,json_encode($lockdomains));
}
?>